import request from '@/utils/request';


export async function queryRule(params) {
  const limit = params.pageSize;
  const page = params.current;
  const my_params = {
    limit: limit,
    page: page,
  };
  Object.assign(params, my_params);
  delete params.current;
  delete params.pageSize;
  return request('/message/smsTemplate/page', {
    params,
  });
}

export async function queryVariable() {
  const my_params = {
    limit: 10000,
    page: 1,
  };
  return request('/message/smsActionField/page', {
    my_params,
  });
};
export async function getAction() {
  const my_params = {
    limit: 10000,
    page: 1,
  };
  return request('/message/smsAction/page', {
    my_params,
  });
};
export async function getActionField(params) {
  return request(`/message/smsActionField/list?parentId=${params}`);
};


export async function removeRule(params) {
  return request(`message/smsTemplate/${params}`, {
    method: 'DELETE',
  });
}
export async function addRule(params) {
  return request('/message/smsTemplate', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
export async function updateRule(params) {
  return request('/message/smsTemplate', {
    method: 'PUT',
    data: {
      ...params,
    },
  });
}
